﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using VoteServer.Member;
using VoteServer;

namespace VoteSecond
{
/// <summary>
/// 使用summary注释一个类是当你调用这个类的时候会显示你的注释内容。
/// </summary>
    class Vote//面板
    {
        public static void Main(string[] args)
        {
            
            VoteControl control = new VoteControl();
            User user = new User();

            Console.WriteLine("注册");
            Console.WriteLine("用户名:");
            user.UserName=Console.ReadLine();
            Console.WriteLine("登录密码:");
            user.Password=Console.ReadLine();

            control.Enroll(user.UserName,user.Password);


            Thread.Sleep(2000);
            Console.Clear();
            Console.WriteLine("登录");
         
            Console.WriteLine("用户名:");
            user.UserName = Console.ReadLine();
            Console.WriteLine("登录密码:");
            user.Password = Console.ReadLine();

           if(control.Login(user.UserName, user.Password))
            {
                Console.WriteLine("登录成功");
            }
           else
            {
                Console.WriteLine("密码或账号错误");
            }



        }
    }
}
